<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>std.socketstream</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "std.socketstream";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/std.socketstream.html" class="symbol">std.socketstream</a></h1>
  
<div class="summary"><b>SocketStream</b> is a stream for a blocking,
 connected <b>Socket</b>.</div>
For Win32 systems, link with <tt>ws2_32.lib</tt>.
<p class="sec_header">Example:</p>See <tt>/dmd/samples/d/htmlget.d</tt>
<p class="sec_header">Authors:</p>Christopher E. Miller
<p class="sec_header">References:</p><a href="std_stream.html">std.stream</a>
<dl>
<dt class="decl">class <a class="symbol _class" name="SocketStream" href="./htmlsrc/std.socketstream.html#L44" kind="class" beg="44" end="141">SocketStream</a> : Stream; <a title="Permalink to this symbol" href="#SocketStream" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.socketstream.html#L44">#</a></dt>
<dd class="ddef">
<div class="summary"><b>SocketStream</b> is a stream for a blocking,
 connected <b>Socket</b>.</div>
<dl>
<dt class="decl">Socket <a class="symbol _variable" name="SocketStream.sock" href="./htmlsrc/std.socketstream.html#L47" kind="variable" beg="47" end="47">sock</a>; <span class="attrs">[<span class="prot">private</span>]</span> <a title="Permalink to this symbol" href="#SocketStream.sock" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.socketstream.html#L47">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl"><a class="symbol _ctor" name="SocketStream.this" href="./htmlsrc/std.socketstream.html#L54" kind="ctor" beg="54" end="62">this</a><span class="params">(Socket <em>sock</em>, FileMode <em>mode</em>)</span>; <span class="attrs">[<span class="prot">public</span>]</span> <a title="Permalink to this symbol" href="#SocketStream.this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.socketstream.html#L54">#</a></dt>
<dd class="ddef">
<div class="summary">Constructs a SocketStream with the specified Socket and FileMode flags.</div></dd>
<dt class="decl"><a class="symbol _ctor" name="SocketStream.this:2" href="./htmlsrc/std.socketstream.html#L67" kind="ctor" beg="67" end="71">this</a><span class="params">(Socket <em>sock</em>)</span>; <span class="attrs">[<span class="prot">public</span>]</span> <a title="Permalink to this symbol" href="#SocketStream.this:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.socketstream.html#L67">#</a></dt>
<dd class="ddef">
<div class="summary">Uses mode <b>FileMode.In | FileMode.Out</b>.</div></dd>
<dt class="decl">Socket <a class="symbol _function" name="SocketStream.socket" href="./htmlsrc/std.socketstream.html#L76" kind="function" beg="76" end="79">socket</a><span class="params">()</span>; <span class="attrs">[<span class="prot">public</span>]</span> <a title="Permalink to this symbol" href="#SocketStream.socket" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.socketstream.html#L76">#</a></dt>
<dd class="ddef">
<div class="summary">Property to get the <b>Socket</b> that is being streamed.</div></dd>
<dt class="decl">size_t <a class="symbol _function" name="SocketStream.readBlock" href="./htmlsrc/std.socketstream.html#L84" kind="function" beg="84" end="97">readBlock</a><span class="params">(void* <em>_buffer</em>, size_t <em>size</em>)</span>; <span class="attrs">[<span class="prot">public</span>, <span class="stc">override</span>]</span> <a title="Permalink to this symbol" href="#SocketStream.readBlock" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.socketstream.html#L84">#</a></dt>
<dd class="ddef">
<div class="summary">Attempts to read the entire block, waiting if necessary.</div></dd>
<dt class="decl">size_t <a class="symbol _function" name="SocketStream.writeBlock" href="./htmlsrc/std.socketstream.html#L102" kind="function" beg="102" end="115">writeBlock</a><span class="params">(void* <em>_buffer</em>, size_t <em>size</em>)</span>; <span class="attrs">[<span class="prot">public</span>, <span class="stc">override</span>]</span> <a title="Permalink to this symbol" href="#SocketStream.writeBlock" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.socketstream.html#L102">#</a></dt>
<dd class="ddef">
<div class="summary">Attempts to write the entire block, waiting if necessary.</div></dd>
<dt class="decl">ulong <a class="symbol _function" name="SocketStream.seek" href="./htmlsrc/std.socketstream.html#L120" kind="function" beg="120" end="123">seek</a><span class="params">(long <em>offset</em>, SeekPos <em>whence</em>)</span>; <span class="attrs">[<span class="prot">public</span>, <span class="stc">override</span>]</span> <a title="Permalink to this symbol" href="#SocketStream.seek" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.socketstream.html#L120">#</a></dt>
<dd class="ddef">
<div class="summary"></div></dd>
<dt class="decl">char[] <a class="symbol _function" name="SocketStream.toString" href="./htmlsrc/std.socketstream.html#L129" kind="function" beg="129" end="132">toString</a><span class="params">()</span>; <span class="attrs">[<span class="prot">public</span>, <span class="stc">override</span>]</span> <a title="Permalink to this symbol" href="#SocketStream.toString" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.socketstream.html#L129">#</a></dt>
<dd class="ddef">
<div class="summary">Does not return the entire stream because that would
 require the remote connection to be closed.</div></dd>
<dt class="decl">void <a class="symbol _function" name="SocketStream.close" href="./htmlsrc/std.socketstream.html#L137" kind="function" beg="137" end="140">close</a><span class="params">()</span>; <span class="attrs">[<span class="prot">public</span>, <span class="stc">override</span>]</span> <a title="Permalink to this symbol" href="#SocketStream.close" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.socketstream.html#L137">#</a></dt>
<dd class="ddef">
<div class="summary">Close the <b>Socket</b>.</div></dd></dl></dd></dl>
</div>
<div id="footer">
  <p>Copyright © 1999-2008 by Digital Mars ®, All Rights Reserved.</p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Fri Dec 26 03:40:10 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>